<?php
require_once "getYoutubeFlv.php";
require_once "batchDBManager.php";
require_once "videoConvertManager.php";

$video_id=$argv[1]; 
$carrier_id=$argv[2];

//$video_id=7; 
//$carrier_id=1;


//TODO get cid by video_id
$dbMgr = new BatchDBManager();
$cid=$dbMgr->getCid($video_id);
//echo "<br/>$cid<br/>";
$flvUrlMan =  new YoutubeManager();
$flvUrl =$flvUrlMan->getFlvUrl($cid);
//echo "<br/>$flvUrl";
$myConv = new VideoConvertManager();
$myConv->init($cid,$video_id,$carrier_id,$flvUrl);
echo $carrier_id;
$myConv->doConvert(); 


?>
~
